package com.dupt.system.service.impl;

import java.util.List;
import com.dupt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dupt.system.mapper.MaterialListMapper;
import com.dupt.system.domain.MaterialList;
import com.dupt.system.service.IMaterialListService;

/**
 * 组装用料清单Service业务层处理
 * 
 * @author zhuanyu.sun
 * @date 2025-07-05
 */
@Service
public class MaterialListServiceImpl implements IMaterialListService
{
    @Autowired
    private MaterialListMapper materialListMapper;

    /**
     * 查询组装用料清单
     * 
     * @param materialListId 组装用料清单主键
     * @return 组装用料清单
     */
    @Override
    public MaterialList selectMaterialListByMaterialListId(Long materialListId)
    {
        return materialListMapper.selectMaterialListByMaterialListId(materialListId);
    }

    /**
     * 查询组装用料清单列表
     * 
     * @param materialList 组装用料清单
     * @return 组装用料清单
     */
    @Override
    public List<MaterialList> selectMaterialListList(MaterialList materialList)
    {
        return materialListMapper.selectMaterialListList(materialList);
    }

    /**
     * 新增组装用料清单
     * 
     * @param materialList 组装用料清单
     * @return 结果
     */
    @Override
    public int insertMaterialList(MaterialList materialList)
    {
        materialList.setCreateTime(DateUtils.getNowDate());
        return materialListMapper.insertMaterialList(materialList);
    }

    /**
     * 修改组装用料清单
     * 
     * @param materialList 组装用料清单
     * @return 结果
     */
    @Override
    public int updateMaterialList(MaterialList materialList)
    {
        materialList.setUpdateTime(DateUtils.getNowDate());
        return materialListMapper.updateMaterialList(materialList);
    }

    /**
     * 批量删除组装用料清单
     * 
     * @param materialListIds 需要删除的组装用料清单主键
     * @return 结果
     */
    @Override
    public int deleteMaterialListByMaterialListIds(Long[] materialListIds)
    {
        return materialListMapper.deleteMaterialListByMaterialListIds(materialListIds);
    }

    /**
     * 删除组装用料清单信息
     * 
     * @param materialListId 组装用料清单主键
     * @return 结果
     */
    @Override
    public int deleteMaterialListByMaterialListId(Long materialListId)
    {
        return materialListMapper.deleteMaterialListByMaterialListId(materialListId);
    }
}
